package com.ymh.git.thread;

public class Test {

	public static void main(String[] args) {
		//System.out.println(Thread.currentThread().getName());//获取main线程的名称
		MyThread myThread = new MyThread();
		myThread.setName("myThread");
		myThread.start();
		for (int i = 0; i < 10; i++) {
			int time = (int) (Math.random() * 1000);
			try {
				Thread.sleep(time);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("main=" + Thread.currentThread().getName());
		}
		
	}

}
